/*
 * @description: 
 * @param: 
 * @return: 
 */
import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { FollowOrderVO, FollowOrderForm, FollowOrderQuery } from '@/api/goods/followOrder/types';

/**
 * 查询跟单续费列表
 * @param query
 * @returns {*}
 */

export const listFollowOrder = (query?: FollowOrderQuery): AxiosPromise<FollowOrderVO[]> => {
  return request({
    url: '/order/followOrder/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询跟单续费详细
 * @param id
 */
export const getFollowOrder = (id: string | number): AxiosPromise<FollowOrderVO> => {
  return request({
    url: '/order/followOrder/' + id,
    method: 'get'
  });
};

/**
 * 新增跟单续费
 * @param data
 */
export const addFollowOrder = (data: FollowOrderForm) => {
  return request({
    url: '/order/followOrder',
    method: 'post',
    data: data
  });
};

/**
 * 修改跟单续费
 * @param data
 */
export const updateFollowOrder = (data: FollowOrderForm) => {
  return request({
    url: '/order/followOrder',
    method: 'put',
    data: data
  });
};

/**
 * 删除跟单续费
 * @param id
 */
export const delFollowOrder = (id: string | number | Array<string | number>) => {
  return request({
    url: '/order/followOrder/' + id,
    method: 'delete'
  });
};

/**
 * 审核跟单续费
 * @param data
 */
export const auditFollowOrder = (data: FollowOrderForm) => {
  return request({
    url: '/order/followOrder/audit',
    method: 'post',
    data: data
  });
};

export default {
  list: listFollowOrder,
  get: getFollowOrder,
  add: addFollowOrder,
  update: updateFollowOrder,
  del: delFollowOrder,
  audit: auditFollowOrder
}